package com.ruoyi.boss.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.boss.mapper.TCarTypeMapper;
import com.ruoyi.boss.domain.TCarType;
import com.ruoyi.boss.service.ITCarTypeService;

/**
 * 车型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-17
 */
@Service
public class TCarTypeServiceImpl implements ITCarTypeService 
{
    @Autowired
    private TCarTypeMapper tCarTypeMapper;

    /**
     * 查询车型
     * 
     * @param carTypeId 车型主键
     * @return 车型
     */
    @Override
    public TCarType selectTCarTypeByCarTypeId(Long carTypeId)
    {
        return tCarTypeMapper.selectTCarTypeByCarTypeId(carTypeId);
    }

    /**
     * 查询车型列表
     * 
     * @param tCarType 车型
     * @return 车型
     */
    @Override
    public List<TCarType> selectTCarTypeList(TCarType tCarType)
    {
        return tCarTypeMapper.selectTCarTypeList(tCarType);
    }

    /**
     * 新增车型
     * 
     * @param tCarType 车型
     * @return 结果
     */
    @Override
    public int insertTCarType(TCarType tCarType)
    {
        tCarType.setCreateTime(DateUtils.getNowDate());
        return tCarTypeMapper.insertTCarType(tCarType);
    }

    /**
     * 修改车型
     * 
     * @param tCarType 车型
     * @return 结果
     */
    @Override
    public int updateTCarType(TCarType tCarType)
    {
        tCarType.setUpdateTime(DateUtils.getNowDate());
        return tCarTypeMapper.updateTCarType(tCarType);
    }

    /**
     * 批量删除车型
     * 
     * @param carTypeIds 需要删除的车型主键
     * @return 结果
     */
    @Override
    public int deleteTCarTypeByCarTypeIds(Long[] carTypeIds)
    {
        return tCarTypeMapper.deleteTCarTypeByCarTypeIds(carTypeIds);
    }

    /**
     * 删除车型信息
     * 
     * @param carTypeId 车型主键
     * @return 结果
     */
    @Override
    public int deleteTCarTypeByCarTypeId(Long carTypeId)
    {
        return tCarTypeMapper.deleteTCarTypeByCarTypeId(carTypeId);
    }
}
